package prgechecsmodel;

public interface IDefinition {

    int WHITE_TO_MOVE = 1;
    int BLACK_TO_MOVE = -1;
    public static final int W_KING = 1;
    public static final int W_QUEEN = 2;
    public static final int W_ROOK = 3;
    public static final int W_BISHOP = 4;
    public static final int W_KNIGHT = 5;
    public static final int W_PAWN = 6;
    public static final int B_KING = -1;
    public static final int B_QUEEN = -2;
    public static final int B_ROOK = -3;
    public static final int B_BISHOP = -4;
    public static final int B_KNIGHT = -5;
    public static final int B_PAWN = -6;
    public static final int EMPTY_SQUARE = 0;
    public static final int CASTLE_NONE = 0;
    public static final int CASTLE_SHORT = 1;
    public static final int CASTLE_LONG = 2;
    public static final int CASTLE_BOTH = 3;
    final static int LIGHT = 0;
    final static int DARK = 1;
    final static int PAWN = 0;
    final static int KNIGHT = 1;
    final static int BISHOP = 2;
    final static int ROOK = 3;
    final static int QUEEN = 4;
    final static int KING = 5;
    final static int EMPTY = 6;
    final static char A1 = 56;
    final static char B1 = 57;
    final static char C1 = 58;
    final static char D1 = 59;
    final static char E1 = 60;
    final static char F1 = 61;
    final static char G1 = 62;
    final static char H1 = 63;
    final static char A8 = 0;
    final static char B8 = 1;
    final static char C8 = 2;
    final static char D8 = 3;
    final static char E8 = 4;
    final static char F8 = 5;
    final static char G8 = 6;
    final static char H8 = 7;
    final static int DOUBLED_PAWN_PENALTY = 10;
    final static int ISOLATED_PAWN_PENALTY = 20;
    final static int BACKWARDS_PAWN_PENALTY = 8;
    final static int PASSED_PAWN_BONUS = 20;
    final static int ROOK_SEMI_OPEN_FILE_BONUS = 10;
    final static int ROOK_OPEN_FILE_BONUS = 15;
    final static int ROOK_ON_SEVENTH_BONUS = 20;
    final static int HIST_STACK = 400;
    int pawnRank[][] = new int[ 2 ][ 10 ];
    int pieceMat[] = new int[ 2 ];
    int pawnMat[] = new int[ 2 ];
    int color[] = {
        1, 1, 1, 1, 1, 1, 1, 1,
        1, 1, 1, 1, 1, 1, 1, 1,
        6, 6, 6, 6, 6, 6, 6, 6,
        6, 6, 6, 6, 6, 6, 6, 6,
        6, 6, 6, 6, 6, 6, 6, 6,
        6, 6, 6, 6, 6, 6, 6, 6,
        0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0
    };
    int piece[] = {
        3, 1, 2, 4, 5, 2, 1, 3,
        0, 0, 0, 0, 0, 0, 0, 0,
        6, 6, 6, 6, 6, 6, 6, 6,
        6, 6, 6, 6, 6, 6, 6, 6,
        6, 6, 6, 6, 6, 6, 6, 6,
        6, 6, 6, 6, 6, 6, 6, 6,
        0, 0, 0, 0, 0, 0, 0, 0,
        3, 1, 2, 4, 5, 2, 1, 3
    };
    final char pieceChar[] = {'P', 'N', 'B', 'R', 'Q', 'K'};
    boolean slide[] = {false, false, true, true, true, false};
    int offsets[] = {0, 8, 4, 4, 8, 8};
    int offset[][] = {
        {0, 0, 0, 0, 0, 0, 0, 0},
        {-21, -19, -12, -8, 8, 12, 19, 21},
        {-11, -9, 9, 11, 0, 0, 0, 0},
        {-10, -1, 1, 10, 0, 0, 0, 0},
        {-11, -10, -9, -1, 1, 9, 10, 11},
        {-11, -10, -9, -1, 1, 9, 10, 11}
    };
    int mailbox[] = {
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
        -1, 0, 1, 2, 3, 4, 5, 6, 7, -1,
        -1, 8, 9, 10, 11, 12, 13, 14, 15, -1,
        -1, 16, 17, 18, 19, 20, 21, 22, 23, -1,
        -1, 24, 25, 26, 27, 28, 29, 30, 31, -1,
        -1, 32, 33, 34, 35, 36, 37, 38, 39, -1,
        -1, 40, 41, 42, 43, 44, 45, 46, 47, -1,
        -1, 48, 49, 50, 51, 52, 53, 54, 55, -1,
        -1, 56, 57, 58, 59, 60, 61, 62, 63, -1,
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
    };
    int mailbox64[] = {
        21, 22, 23, 24, 25, 26, 27, 28,
        31, 32, 33, 34, 35, 36, 37, 38,
        41, 42, 43, 44, 45, 46, 47, 48,
        51, 52, 53, 54, 55, 56, 57, 58,
        61, 62, 63, 64, 65, 66, 67, 68,
        71, 72, 73, 74, 75, 76, 77, 78,
        81, 82, 83, 84, 85, 86, 87, 88,
        91, 92, 93, 94, 95, 96, 97, 98
    };
    int castleMask[] = {
        7, 15, 15, 15, 3, 15, 15, 11,
        15, 15, 15, 15, 15, 15, 15, 15,
        15, 15, 15, 15, 15, 15, 15, 15,
        15, 15, 15, 15, 15, 15, 15, 15,
        15, 15, 15, 15, 15, 15, 15, 15,
        15, 15, 15, 15, 15, 15, 15, 15,
        15, 15, 15, 15, 15, 15, 15, 15,
        13, 15, 15, 15, 12, 15, 15, 14
    };
    /* the values of the pieces */
    int pieceValue[] = {
        100, 300, 300, 500, 900, 0
    };
    /* The "pcsq" arrays are piece/square tables. They're values
    added to the material value of the piece based on the
    location of the piece. */
    int pawnPcsq[] = {
        0, 0, 0, 0, 0, 0, 0, 0,
        5, 10, 15, 20, 20, 15, 10, 5,
        4, 8, 12, 16, 16, 12, 8, 4,
        3, 6, 9, 12, 12, 9, 6, 3,
        2, 4, 6, 8, 8, 6, 4, 2,
        1, 2, 3, -10, -10, 3, 2, 1,
        0, 0, 0, -40, -40, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0
    };
    int knightPcsq[] = {
        -10, -10, -10, -10, -10, -10, -10, -10,
        -10, 0, 0, 0, 0, 0, 0, -10,
        -10, 0, 5, 5, 5, 5, 0, -10,
        -10, 0, 5, 10, 10, 5, 0, -10,
        -10, 0, 5, 10, 10, 5, 0, -10,
        -10, 0, 5, 5, 5, 5, 0, -10,
        -10, 0, 0, 0, 0, 0, 0, -10,
        -10, -30, -10, -10, -10, -10, -30, -10
    };
    int bishopPcsq[] = {
        -10, -10, -10, -10, -10, -10, -10, -10,
        -10, 0, 0, 0, 0, 0, 0, -10,
        -10, 0, 5, 5, 5, 5, 0, -10,
        -10, 0, 5, 10, 10, 5, 0, -10,
        -10, 0, 5, 10, 10, 5, 0, -10,
        -10, 0, 5, 5, 5, 5, 0, -10,
        -10, 0, 0, 0, 0, 0, 0, -10,
        -10, -10, -20, -10, -10, -20, -10, -10
    };
    int kingPcsq[] = {
        -40, -40, -40, -40, -40, -40, -40, -40,
        -40, -40, -40, -40, -40, -40, -40, -40,
        -40, -40, -40, -40, -40, -40, -40, -40,
        -40, -40, -40, -40, -40, -40, -40, -40,
        -40, -40, -40, -40, -40, -40, -40, -40,
        -40, -40, -40, -40, -40, -40, -40, -40,
        -20, -20, -20, -20, -20, -20, -20, -20,
        0, 20, 40, -20, 0, -20, 40, 20
    };
    int kingEndgamePcsq[] = {
        0, 10, 20, 30, 30, 20, 10, 0,
        10, 20, 30, 40, 40, 30, 20, 10,
        20, 30, 40, 50, 50, 40, 30, 20,
        30, 40, 50, 60, 60, 50, 40, 30,
        30, 40, 50, 60, 60, 50, 40, 30,
        20, 30, 40, 50, 50, 40, 30, 20,
        10, 20, 30, 40, 40, 30, 20, 10,
        0, 10, 20, 30, 30, 20, 10, 0
    };
    /* The flip array is used to calculate the piece/square
    values for DARK pieces. The piece/square value of a
    LIGHT pawn is pawnPcsq[sq] and the value of a DARK
    pawn is pawnPcsq[flip[sq]] */
    int flip[] = {
        56, 57, 58, 59, 60, 61, 62, 63,
        48, 49, 50, 51, 52, 53, 54, 55,
        40, 41, 42, 43, 44, 45, 46, 47,
        32, 33, 34, 35, 36, 37, 38, 39,
        24, 25, 26, 27, 28, 29, 30, 31,
        16, 17, 18, 19, 20, 21, 22, 23,
        8, 9, 10, 11, 12, 13, 14, 15,
        0, 1, 2, 3, 4, 5, 6, 7
    };
}
